# -*- coding: utf-8 -*-
"""
@File:    get_encrypt.py
@Author:  jk.dong 
@Desc:    加解密小工具
"""
import sys
from pathlib import Path


if __name__ == '__main__':
    dir_name = Path(__file__).parent.stem
    print(dir_name)
    if dir_name == 'scripts':
        sys.path.append("..")
        from docwork.utils.crypto import decrypt
        from docwork.config import RUN_CONF
    elif dir_name == 'docwork':
        from docwork.utils.crypto import decrypt
        from docwork.config import RUN_CONF
    else:
        raise "脚本路径异常，无法调用加解密模块"
    # 加载配置文件中的加密模块秘钥
    en_value = decrypt(sys.argv[1], config_=RUN_CONF['run-setting'])
    print(en_value)
